<template>
	<view>
		<view class="main" style="margin-top: 4vw;">

			<view class="center_qb t23">结算规则</view>
			<!-- <view class="shuru">
					<text class="shuru_tit t1">入驻结算规则ID</text>
					<picker mode="multiSelector" class="shuru_text t1" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
					 :range="multiArray">
						<view class="uni-input t1">{{multiArray[0][multiIndex[0]]}}-{{multiArray[1][multiIndex[0]]}}</view>
					</picker>
				</view> -->
			<view class="shuru">
				<text class="shuru_tit t1" style="width: 30%;">所属行业</text>

				<picker mode="multiSelector" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
					:range="multiArray" range-key="name" class="t1 shuru_text2">
					<view class="t1" v-show="multiArray1" style="width: 100%;">{{multiArray1}}</view>
					<view class="t1" v-show="!multiArray1" style="width: 100%;">
						<!-- {{multiArray[index].rootNav}} -->{{multiArray[0][multiIndex[0]].name}}，{{multiArray[1][multiIndex[1]].name}}，{{multiArray[2][multiIndex[2]].name}}
					</view>
				</picker>
			</view>
			<view class="shuru" v-show="required==1" style="position: relative;">
				<text class="shuru_tit t1" style="width: 100%;">特殊资质图片(非必填)</text>
				<view class="baodan_into" @click="chooseImage">
					<!-- <image src="../../static/img/load.gif" class="baodan_into_image_load" mode="widthFix" v-show="xuanimg"></image> -->
					<block v-if="zimage">
						<image :src="zimage" class="baodan_into_image" mode="widthFix"></image>
					</block>
				</view>
				<!-- <view class="uni-padding-wrap uni-common-mt baodan_into1" @click="chooseImage">
				</view> -->
				<!-- <view class="imgi" v-for="(item,index) in zimage" :key="'d'+index">
					<image src="../../static/img/clo.png" class="del" @click="imgdel(item,0)"></image>
					<image :src="item" mode="aspectFill"></image>
				</view> -->
				<!-- <input type="number" class="shuru_text t1" value="" v-model="zizhi" placeholder="请输入特殊资质图片" /> -->
			</view>
			<!-- <view class="center_qb t1">您已申请微信商家支付，请耐心等待审核。<br>
				如有疑问，请联系本平台客服，谢谢合作。</view> -->
			<!-- <view class="shuru">
					<text class="shuru_tit t1">优惠费率活动ID</text>
					<input type="number" class="shuru_text t1" value="" v-model="" placeholder="请输入优惠费率活动ID" />
				</view>
				<view class="shuru">
					<text class="shuru_tit t1">优惠费率活动值</text>
					<input type="number" class="shuru_text t1" value="" v-model="USDT" placeholder="请输入优惠费率活动值" />
				</view>
				<view class="shuru">
					<text class="shuru_tit t1">优惠费率活动补充材料</text>
					<input type="number" class="shuru_text t1" value="" v-model="USDT" placeholder="请输入优惠费率活动补充材料" />
				</view> -->
			<view class="center_qb t23" style="margin-top: 8vw;">结算银行账户</view>
			<!-- <view class="center_qb t1">结算银行账户</view> -->
			<view class="shuru">
				<text class="shuru_tit t1">账户类型</text>
				<picker @change="bindPickerChange" :value="bankAccountType" :range="array" range-key="name"
					class="shuru_text2 t1">
					<view class="t1">{{array[indexi].name}}</view>
				</picker>
				<!-- 	<input type="number" class="shuru_text t1" value="" v-model="bankAccountType"
						placeholder="请输入账户类型" /> -->
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">开户银行省市编码</text>
				<picker mode="multiSelector" @columnchange="bindMultiPickerColumnChange1" :value="dmultiIndex"
					:range="dmultiArray" class="shuru_text2 t1">
					<view class="t1" v-if="adrname!=''">
						{{adrname}}
					</view>
					<view class="t1" v-if="adrname==''">
						{{dmultiArray[0][dmultiIndex[0]]}}，{{dmultiArray[1][dmultiIndex[1]]}}
						<!-- ，{{dmultiArray[2][dmultiIndex[2]]}} -->
					</view>
				</picker>
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">开户银行</text>
				<picker @change="bindPickerChange1" :value="accountBank" :range="array1" range-key="name"
					class="shuru_text2 t1">
					<view class="t1">{{array1[index1].name}}</view>
				</picker>

				<!-- <input type="number" class="shuru_text t1" value="" v-if="!array1" v-model="accountBank" placeholder="请输入开户银行" /> -->
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">卡种</text>
				<picker @change="bindPickerChange2" :range="array2" range-key="name" :value="subBankId"
					class="shuru_text2 t1">
					<view class="t1">{{array2[index2].name}}</view>
				</picker>
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">开户银行全称(含支行)</text>
				<input type="text" class="shuru_text t1" value="" v-model="bankName" placeholder="请输入开户银行全称(含支行)"
					onkeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" @confirm="searchBand"  />
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">开户人姓名</text>
				<input type="text" class="shuru_text t1" value="" v-model="accountName" placeholder="请输入开户人姓名" />
			</view>
			<view class="shuru">
				<text class="shuru_tit t1">银行账号</text>
				<input type="number" class="shuru_text t1" value="" v-model="accountNumber" placeholder="请输入银行账号" />
			</view>
			<view class="center_qb t13" v-if="strs!=''">错误提示：{{strs}}</view>
			<!-- <view class="shuru">
					<text class="shuru_tit t1">开户银行联行号</text>
					<input type="number" class="shuru_text t1" value="" v-model="USDT" placeholder="请输入开户银行联行号" />
				</view> -->
			<view class="tuic t2" @click="queding()" style="width: 100%;margin: 10vw 0;">下一步</view>
			<!-- <view class="tuic2 t2" @click="xiugai()" v-if="types==2" style="width: 100%;margin: 0;margin-bottom: 10vw;">
				修改</view> -->
			<view class="bai"></view>
		</view>
		<u-popup v-model="bankListShow" mode="bottom">
			<scroll-view class="scroll" scroll-y="true" style="max-height: 600rpx;">
				<view v-for="(bank,index) of searchBankList" :key="index" class="bank-item" @click="checkBankItem(bank)">
					{{bank.bankName}}
				</view>
			</scroll-view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bankCardId: '',
				required: 0,
				mainid: '',
				index: 0,
				index2: 0,
				indexi: 0,
				htype1: [],
				htype2: [],
				htype3: [],
				multiArray: [
					[{
						'name': ''
					}],
					[{
						'name': ''
					}],
					[{
						'id': '',
						'name': ''
					}]
				],
				xuanimg: '',
				multiArray1: '',
				multiIndex: [0, 0, 0],
				zimage: '',
				zimageid: '',
				adrname: '',
				qualifications: '',
				hy1: '',
				hy2: '',
				hy3: '',
				settlementIdId: '',
				accountBank: '', //	开户银行		true					string
				accountName: '', //	开户名称		true						string
				accountNumber: '', //	银行账号		true						string
				bankAccountType: '', //	账户类型		true						string
				bankAddressCode: '', //	开户银行省市ID		true							string
				bankName: '', //	开户银行全称		true	
				qualifications1: '',
				settlementIdId1: '',
				accountBank1: '', //	开户银行		true					string
				accountName1: '', //	开户名称		true						string
				accountNumber1: '', //	银行账号		true						string
				bankAccountType1: '', //	账户类型		true						string
				bankAddressCode1: '', //	开户银行省市ID		true							string
				bankName1: '', //	开户银行全称		true						string、
				searchBankList: [],//
				bankListShow: false,
				index1: 0,
				dnui1: [{
					id: '',
					name: ''
				}],
				dnui2: [{
					id: '',
					name: ''
				}],
				dnui3: [{
					id: '',
					name: ''
				}],
				dmultiArray: [
					[],
					[],
					// []
				],
				array1: [{
					id: '',
					name: ''
				}],
				array2: [{
					id: '',
					name: ''
				}],
				array: [{
					id: '',
					name: ''
				}],
				dmultiIndex: [0, 0, 0],
				dpickerid1: '',
				dpickerid2: '',
				types: 0,
				shengid: '',
				bizAddressCode: '',
				bizAddressCode1: '',
				subBankId: '',
				strs: '',
			}
		},
		onLoad() {
			this.imageSrc = '';

			var _this = this;
			uni.getStorage({
				key: 'user',
				success: function(res) {
					_this.mainid = res.data.id;

					_this.hangye(); //用户所属行业信息
					_this.jiesuaninfo();
				}
			});
			// _this.adr();
		},
		methods: {
			imgdel(img, i) {
				// console.log(img)
				// console.log(i)
				if (i == 0) {
					var idlist = [];
					var list = [];
					for (var i = 0; i < this.mdlist.length; i++) {
						if (img != this.mdlist[i]) {
							idlist.push(this.mdidlist[i]);
							list.push(this.mdlist[i]);
						}
					}
					this.mdidlist = idlist;
					this.mdlist = list;
				} else {
					var idlist = [];
					var list = [];
					for (var i = 0; i < this.dnlist.length; i++) {
						if (img != this.dnlist[i]) {
							idlist.push(this.dnidlist[i]);
							list.push(this.dnlist[i]);
						}
					}
					this.dnidlist = idlist;
					this.dnlist = list;
				}
			},
			// 搜索银行
			searchBand(){
				var city = this.dmultiArray[1][this.dmultiIndex[1]]
				var cityName = "";
				var leng = city.length;
				var cityName = city[leng - 1] == "市" ? city.substring(0,leng - 1) : city;
				console.log("cityName",cityName);
				this.$request.post('mch/getBankBranch/' + cityName + '/' + this.bankName ,{
					bankName : this.bankName,
					city : cityName
				}).then((res) => {
					console.log("银行列表: ", res);
					if(res.data.data.length == 0){
						uni.showToast({
							title: '没有获取到相关银行信息',
							icon: 'none',
						})
						return;
					}
					if(res.data.data.length == 1){
						console.log(res.data.data[0]);
						this.bankName = res.data.data[0].bankName;
						this.$forceUpdate();
					}else{
						this.searchBankList = res.data.data;
						uni.hideKeyboard();
						this.bankListShow = true;
					}
					// this.$refs.bankListPop.open();
				})
			},
			// 选择银行
			checkBankItem(bank){
				this.bankName = bank.bankName;
				// this.$refs.bankListPop.close();
				this.bankListShow = false;
			},
			dadr() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'area/areaList/', //仅为示例，并非真实接口地址。
					method: 'POST',
					data: {
						parentId: ''
					},
					success: (res) => {
						console.log('dadr:',res)
						if (res.data.status == '200') {
							_this.dnui1 = res.data.data;
							for (var i = 0; i < res.data.data.length; i++) {
								_this.dmultiArray[0].push(res.data.data[i].name);
							}
							if (_this.dpickerid1 != '') {
								for (let i = 0; i < _this.dmultiArray[0].length; i++) {
									if (_this.dnui1[i].id == _this.dpickerid1) {
										_this.dmultiIndex = [i, 0];
									}
								}

							} else {
								_this.dpickerid1 = res.data.data[0].id;
							}
							_this.dadr1();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			dadr1() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'area/areaList/' + _this.dpickerid1, //仅为示例，并非真实接口地址。
					method: 'POST',
					data: {
						parentId: _this.dpickerid1 //	用户ID（mainId）
					},
					success: (res) => {
						console.log('dadr1...',res)
						if (res.data.status == '200') {
							_this.dnui2 = res.data.data;
							// console.log(_this.bizAddressCode1);
							var list = [];
							for (var i = 0; i < res.data.data.length; i++) {
								if (res.data.data[i].id == _this.bizAddressCode1) {
									_this.dmultiIndex[1] = i;
									this.$forceUpdate()
								}
								list.push(res.data.data[i].name);

							}
							if (this.bizAddressCode1 == '') {
								_this.dpickerid2 = res.data.data[0].id;
								_this.bizAddressCode = res.data.data[0].id;
							}
							this.dmultiArray.splice(1, 1, list)
							// _this.cid = res.data.data[0].id;
							// _this.dadr2();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			bindMultiPickerColumnChange1: function(e) {
				var _this = this;
				_this.adrname1 = '';
				_this.dmultiIndex[e.detail.column] = e.detail.value;
				console.log(e.detail.value);
				if (e.detail.column == 0) {
					_this.dpickerid1 = _this.dnui1[e.detail.value].id;
					_this.provinceId = _this.dnui1[e.detail.value].id;
					_this.dmultiIndex = [e.detail.value, 0];
					_this.dadr1();
				} else if (e.detail.column == 1) {
					_this.dpickerid2 = _this.dnui2[e.detail.value].id;
					_this.cityId = _this.dnui2[e.detail.value].id;
					_this.bizAddressCode = _this.dnui2[e.detail.value].id;
					_this.bizAddressCode1 = _this.dnui2[e.detail.value].id;
				}
				this.$forceUpdate()
			},
			bindMultiPickerColumnChange: function(e) {
				var _this = this;
				_this.settlementIdId = '';
				_this.multiArray1 = '';
				_this.multiIndex[e.detail.column] = e.detail.value;
				console.log(e.detail.value);
				if (e.detail.column == 0) {
					_this.hy1 = _this.multiArray[e.detail.column][e.detail.value].name;
					_this.yinhangtype1();
				} else if (e.detail.column == 1) {
					_this.hy2 = _this.multiArray[e.detail.column][e.detail.value].name;
					// _this.multiIndex[2] = 0;
					_this.yinhangtype2();
				} else if (e.detail.column == 2) {
					_this.hy3 = _this.multiArray[e.detail.column][e.detail.value].name;
					// _this.multiIndex[2] = e.detail.value;
					_this.settlementIdId = _this.multiArray[e.detail.column][e.detail.value].id;
					if (_this.multiArray[e.detail.column][e.detail.value].required == 1) {
						_this.required = 1;
					} else {
						_this.required = 0;
					}
				}
				console.log(_this.multiIndex);
				this.$forceUpdate()
			},
			//获取结算信息
			jiesuaninfo() {
				var _this = this;
				// console.log(_this.mainid);
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getSettle/' + _this.mainid, //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						id: _this.mainid //	用户ID（mainId）
					},
					success: (res) => {
						console.log(res);
						if (res.data.status == '200') {
							if (res.data.data) {
								_this.types = 2;
								_this.bankCardId = res.data.data.bankCard.id;
								_this.dpickerid1 = res.data.data.bankCard.area.parentId;
								_this.bizAddressCode1 = res.data.data.bankCard.area.id;
								_this.bizAddressCode = res.data.data.bankCard.area.id;
								_this.dpickerid2 = res.data.data.bankCard.area.id;
								_this.accountBank = res.data.data.bankCard.bank.id;
								_this.subBankId = res.data.data.bankCard.subBank.id;
								_this.bankName = res.data.data.bankCard.branchName;
								_this.bankAccountType = res.data.data.bankCard.bankCardType.id;
								_this.bankAccountType1 = res.data.data.bankCard.bankCardType.id;
								// _this.subBankId = res.data.data.subBankId;
								_this.accountName = res.data.data.bankCard.name;

								_this.accountNumber = res.data.data.bankCard.number;


							}
							_this.shyinhangleixing(); //账户类型
							_this.dadr(); //银行所属省市
							_this.shyhlist(); //银行列表
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},

			// 获取结算银行卡信息用户所属行业信息
			hangye() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getIndustry/' + _this.mainid, //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						id: _this.mainid //	用户ID（mainId）
					},
					success: (res) => {
						console.log(res);
						if (res.data.status == '200') {
							if (res.data.data) {
								console.log(res.data.data)
								_this.multiArray1 = res.data.data.industry.rootNav + '，' + res.data.data
									.industry.subNav + '，' + res.data.data.industry.name;
								// console.log(_this.multiArray1);
								_this.settlementIdId = res.data.data.industry.id;
								if (res.data.data.picIds) {
									_this.zimage = res.data.data.pics[0].domain + res.data.data.pics[0]
										.localPath;
									_this.zimageid = res.data.data.pics[0].id;
								}
								// console.log(_this.zimage);
							}

							_this.yinhangtype();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			//获取行业类型
			yinhangtype() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getIndustryList', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						"level": 1,
						"parentName": ""
					},
					success: (res) => {
						console.log(res.data.data);
						if (res.data.status == '200') {
							var list = [];
							for (var i = 0; i < res.data.data.length; i++) {
								var li = {
									name: res.data.data[i].rootNav

								}
								list.push(li);
							}
							_this.multiArray[0] = list;
							// _this.settlementIdId = res.data.data[0].id;
							_this.hy1 = res.data.data[0].rootNav;
							this.$forceUpdate();
							_this.yinhangtype1();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			yinhangtype1() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getIndustryList', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						"level": 2,
						"parentName": _this.hy1
					},
					success: (res) => {
						console.log(res.data.data);
						if (res.data.status == '200') {
							var list = [];
							for (var i = 0; i < res.data.data.length; i++) {
								var li = {
									name: res.data.data[i].subNav

								}
								list.push(li);
							}
							_this.multiArray[1] = list;
							// _this.multiArray[1] = res.data.data;
							// _this.settlementIdId = res.data.data[0].id;
							_this.hy2 = res.data.data[0].subNav;
							this.$forceUpdate();
							_this.yinhangtype2();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			yinhangtype2() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getIndustryList', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						"level": 3,
						"parentName": _this.hy2
					},
					success: (res) => {
						// console.log(res.data.data);
						if (res.data.status == '200') {
							_this.multiArray[2] = res.data.data;
							_this.hy3 = res.data.data[0].name;
							if (res.data.data[0].required == 1) {
								_this.required = 1;
							} else {
								_this.required = 0;
							}
							console.log(_this.multiArray1)
							if (!_this.multiArray1) {
								_this.settlementIdId = res.data.data[0].id;
							}
							// console.log(_this.hy3);
							this.$forceUpdate();
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},

			//获取银行卡/账户类型
			shyinhangleixing() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getBankCardTypeList', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						// id: _this.mainid //	用户ID（mainId）
					},
					success: (res) => {
						// console.log(res);
						if (res.data.status == '200') {
							_this.array = res.data.data;
							// console.log(_this.bankAccountType1)
							if (_this.bankAccountType1 == '') {
								_this.bankAccountType = res.data.data[0].id;
							} else {
								for (let i = 0; i < _this.array.length; i++) {
									if (_this.array[i].id == _this.bankAccountType) {
										_this.indexi = i;
									}
								}
							}
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			//获取银行列表
			shyhlist() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getBank', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						// id: _this.mainid //	用户ID（mainId）
					},
					success: (res) => {
						if (res.data.status == '200') {
							if (res.data.data) {
								// console.log(res.data.data);
								_this.array1 = res.data.data;
								if (_this.accountBank == '') {
									_this.accountBank = _this.array1[0].id;
								} else {
									for (let i = 0; i < _this.array1.length; i++) {
										if (_this.array1[i].id == _this.accountBank) {
											_this.index1 = i;
										}
									}
								}
								_this.yhkhlist();
							}
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			//获取卡种列表
			yhkhlist() {
				var _this = this;
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getSubBank/' + _this.accountBank, //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						id: _this.accountBank //	开户行id（mainId）
						// id: _this.mainid //	用户ID（mainId）
					},
					success: (res) => {
						console.log(res)
						if (res.data.status == '200') {
							_this.array2 = res.data.data;								
							if(_this.subBankId==''){
							_this.subBankId = res.data.data[0].id;
							}else{
								for (let i = 0; i < _this.array2.length; i++) {
									if (_this.array2[i].id == _this.subBankId) {
										// console.log(i)
										_this.index2 = i;
									}
								}
							}
							// setTimeout(function() {
							// _this.jiesuaninfo();
							// }, 500)
						}
					},
					fail: (error) => {
						console.log(error)
					}
				});
			},
			chooseImage: function() {
				var _this = this;
				uni.chooseImage({
					count: 1,
					sizeType: ['compressed'],
					sourceType: ['album'],
					success: function(res) {
						// _this.xuanimg=1;
						console.log(res.tempFilePaths);
						var tempFilePaths = res.tempFilePaths;
						var uploadTask = uni.uploadFile({
							url: getApp().globalData.url + 'file/uploadThird',
							filePath: tempFilePaths[0],
							name: 'file',
							formData: {},
							success: function(uploadFileRes) {
								// _this.xuanimg=0;
								// console.log(uploadFileRes);
								var datamain = JSON.parse(uploadFileRes.data);
								// console.log(datamain);
								var url = datamain.data.domain + datamain.data.localPath;
								_this.zimage = url;
								_this.zimageid = datamain.data.id;
							}
						});
					},
					error: function(e) {
						// _this.xuanimg=0;
						console.log(e);
						uni.showToast({
							title: '上传失败',
							icon: 'none',
							duration: 1000
						})
					}
				});

			},
			bindPickerChange: function(e) {
				var that = this;
				var ii = e.detail.value;
				that.bankAccountType = that.array[ii].id;
				that.indexi = ii;
				console.log(that.bankAccountType);
			},
			bindPickerChange1: function(e) {
				var that = this;
				var ii = e.detail.value;
				console.log(ii);
				that.accountBank = that.array1[ii].id;
				that.index1 = ii;
				console.log(that.array1);
				console.log(that.accountBank);
				that.yhkhlist();
			},
			bindPickerChange2: function(e) {
				var that = this;
				var ii = e.detail.value;
				that.subBankId = that.array2[ii].id;
				that.index2 = ii;
				console.log(that.subBankId);
			},
			xiugai() {
				var _this = this;
				// if (_this.checks == false) {
				// 	return false
				// }
				// if (_this.settlementIdId == _this.settlementIdId1 && _this.qualifications == _this.qualifications1 && _this
				// 	.accountName == _this.accountName1 && _this
				// 	.accountBank == _this.accountBank1 && _this.accountNumber ==
				// 	_this.accountNumber1 && _this.bankAccountType == _this.bankAccountType1 && _this.bankAddressCode ==
				// 	_this.bankAddressCode1 && _this.bankName == _this.bankName1) {
				// 	uni.showToast({
				// 		title: '信息暂无修改',
				// 		icon: 'none',
				// 		duration: 2000
				// 	});
				// 	return false
				// }
				if (this.required == 1) {
					if (!_this.zimage) {
						uni.showToast({
							title: '请上传特殊资质图片',
							icon: 'none',
							duration: 2000
						});
						return false
					}
				}
				if (!_this.accountName) {
					uni.showToast({
						title: '请输入开户名称',
						icon: 'none',
						duration: 2000
					});
					return false
				}
				if (!_this.bankName) {
					uni.showToast({
						title: '请输入开户银行全称',
						icon: 'none',
						duration: 2000
					});
					return false
				}
				if (!_this.accountNumber) {
					uni.showToast({
						title: '请输入开户银行账号',
						icon: 'none',
						duration: 2000
					});
					return false
				}
				// _this.checks = false
				_this.uphangye();

			},
			queding() {
				var _this = this;
				_this.types = 1
				if (_this.types == 2) {
					uni.navigateTo({
						url: '/pages/shenqing/shenqing_tijiao'
					});
				} else {
					// if (_this.checks == false) {
					// 	return false
					// }
					if (this.required == 1) {
						if (!_this.zimage) {
							uni.showToast({
								title: '请上传特殊资质图片',
								icon: 'none',
								duration: 2000
							});
							return false
						}
					}
					if (!_this.accountName) {
						uni.showToast({
							title: '请输入开户名称',
							icon: 'none',
							duration: 2000
						});
						return false
					}
					if (!_this.bankName) {
						uni.showToast({
							title: '请输入开户银行全称',
							icon: 'none',
							duration: 2000
						});
						return false
					}
					if (!_this.accountNumber) {
						uni.showToast({
							title: '请输入开户银行账号',
							icon: 'none',
							duration: 2000
						});
						return false
					}
					// _this.checks = false
					// _this.upjiesuanguize();

					_this.uphangye();
				}

			},
			//修改行业
			uphangye() {
				var _this = this;
				// console.log(_this.mainid, _this.settlementIdId, _this.zimageid);
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/updateIndustry', //仅为示例，并非真实接口地址。
					method: 'post',
					data: {
						id: _this.mainid, //	用户ID（mainId）id	用户ID（mainId）		true	string
						industryId: _this.settlementIdId, //	所属行业Id		true	string
						picIds: _this.zimageid, //	特殊资质图片
					},
					success: (res) => {
						// _this.checks = true;
						console.log(res);
						if (res.data.status == '200') {
							_this.upjiesuanzhanghu();
						} else if (res.data.status == '501') {
							let str = "";
							for (var a in res.data.data) str += res.data.data[a] + ";\n";
							if (_this.strs == '') {
								_this.strs = str;
							} else {
								_this.strs = _this.strs + ';' + str;
							}
							// uni.showToast({
							// 	title: str,
							// 	icon: 'none',
							// 	duration: 3000
							// });
						} else {

							uni.showToast({
								title: '行业提交失败',
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						// _this.checks = true;

						uni.showToast({
							title: '行业提交失败',
							icon: 'none',
							duration: 2000
						});
					}
				});
			},
			//修改结算银行卡
			upjiesuanzhanghu() {
				var _this = this;
				var bankCard = {
					areaId: _this.bizAddressCode, //	省市ID		false					string
					bankId: _this.accountBank, //	开户银行		false						string
					id: _this.bankCardId, //	id		false						string
					name: _this.accountName, //		开户名		false						string
					number: _this.accountNumber, //	卡号		false						string
					subBankId: _this.subBankId, ////	卡类型(借记卡，信用卡)		false	string
					branchName: _this.bankName, //	开户银行支行		false						string
					type: _this.bankAccountType, //	类型(对公，对私)		false						string
				};

				var data = {
					bankCard: bankCard, //	银行卡信息		true						BankCard对象					BankCard对象
					bankCardId: _this.bankCardId, //	结算银行卡		false						string
					id: _this.mainid, //	id		false						string
				};
				console.log(bankCard);
				console.log(_this.mainid, _this.bankCardId);
				console.log(data);
				// return;
				data = JSON.stringify(data);
				uni.request({
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/updateSettle', //仅为示例，并非真实接口地址。
					method: 'post',
					data: data,
					success: (res) => {
						console.log(res);
						if (res.data.status == '200') {
							uni.showToast({
								title: '结算信息提交成功',
								icon: 'none',
								duration: 2000
							});
							_this.jiesuaninfo();
							// _this.yinhanginfo();
							setTimeout(function() {
								uni.navigateTo({
									url: '/pages/shenqing/shenqing_tijiao'
								});
							}, 2000);
						} else if (res.data.status == '501') {
							let str = "";
							for (var a in res.data.data) str += res.data.data[a] + ";\n";
							if (_this.strs == '') {
								_this.strs = str;
							} else {
								_this.strs = _this.strs + ';' + str;
							}
							// uni.showToast({
							// 	title: str,
							// 	icon: 'none',
							// 	duration: 3000
							// });
						} else {

							uni.showToast({
								title: '结算信息提交失败',
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						uni.showToast({
							title: '结算信息提交失败',
							icon: 'none',
							duration: 2000
						});
					}
				});
			},
		}
	}
</script>

<style>
	.bai {
		width: 100%;
		height: 30vw;
		display: block;
		float: left;
	}
	
	.bank-item{
		height: 80rpx;
		width: 100%;
		display: flex;
		align-items: center;
		color: #303133;
		font-size: 30rpx;
		box-sizing: border-box;
		padding: 0 30rpx;
		border-bottom: 1rpx solid #F1F1F1;
	}
	
	.center_qb {
		width: 100%;
		height: auto;
		line-height: 8vw;
		display: block;
		float: left;
		padding: 2vw 0;
	}

	.login_main_li_yzm {
		width: auto;
		height: 8vw;
		display: block;
		float: right;
		background: #fcbe16;
		padding: 0 3vw;
		line-height: 8vw;
		border-radius: 4vw;
	}

	.shuru {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		border-radius: 2vw;
		overflow: hidden;
		padding: 2vw 4vw;
		background: #fff;
		margin-top: 3vw;
		box-shadow: 0px 0px 1vw #ddd;
	}

	.shuru_tit {
		width: 30%;
		height: 10vw;
		line-height: 10vw;
		display: block;
		float: left;
	}

	.shuru_text {
		width: 50%;
		height: 10vw;
		line-height: 10vw;
		display: block;
		float: right;
		text-align: right;
	}

	select.shuru_text {
		border: none;
	}

	.baodan_zhu {
		width: 90%;
		height: auto;
		display: block;
		float: left;
		margin: 2vw 5%;
		background: #fff;
		border-radius: 2vw;
		padding: 4vw;
		box-shadow: 0px 0px 1vw #ccc;
		margin-top: 3vw;
	}

	.baodan_tit {
		width: 100%;
		height: 8vw;
		line-height: 8vw;
		display: block;
		float: left;
		text-align: center;
	}

	.baodan_into {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		line-height: 7vw;
		float: left;
		min-height: 40vw;
		background: url(../../static/img/jiaa.png) no-repeat center;
		padding-bottom: 4vw;
	}

	.baodan_into_image {
		width: 90%;
		height: auto;
		display: block;
		float: left;
		margin: 0 5%;
	}

	.baodan_into_image_load {
		width: 20vw;
		height: 20vw;
		position: absolute;
		top: 12vw;
		left: 50%;
		z-index: 999;
		background: #000;
		padding: 7vw;
		border-radius: 3vw;
		margin-left: -10vw;
	}

	.shuru_text2 {
		width: 65%;
		height: auto;
		min-height: 6vw;
		float: left;
		background: url(../../static/img/turn.png) no-repeat right center;
		background-size: 3vw;
		line-height: 6vw;
		text-align: right;
		padding: 2vw 0;
		padding-right: 4vw;
	}
</style>
